package com.xydtech.ecard.config.controller;

import com.xydtech.common.enums.ApiContant;
import com.xydtech.common.model.ResponseModel;
import com.xydtech.common.utils.ShiroUtils;
import com.xydtech.ecard.config.domain.EcardApiSysConfig;
import com.xydtech.ecard.config.service.IEcardApiSysConfigService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.xydtech.common.core.controller.BaseController;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 参数配置Controller
 * 
 * @author Daniel
 * @date 2021-09-26
 */
@Controller
@Api(tags ="电子名片-配置管理")
@RequestMapping("/ecardSaasApi/config")
public class EcardApiSysConfigController extends BaseController
{
    private String prefix = "ecard/config";

    @Autowired
    private IEcardApiSysConfigService ecardApiSysConfigService;

    /**
     * 电子名片-业务预约登记-获取客户已经预约过的业务
     * @return
     */
    @PostMapping("/getTecentMapKey")
    @ApiOperation(value = "电子名片-配置管理-获取腾讯地图Key", notes = "电子名片-配置管理-获取腾讯地图Key")
    @ApiResponses({ @ApiResponse(code = 0, message = "OK", response = EcardApiSysConfig.class) })
    @ResponseBody
    public ResponseModel getTecentMapKey() {
        String tecentMaKey = ecardApiSysConfigService.selectConfigByKey(ApiContant.TECENT_MAP_KEY, ShiroUtils.getSysUser().getDeptId());
        return ResponseModel.ok(tecentMaKey);
    }

}
